//
//  CategorTableViewCell.m
//  Coco_Music
//
//  Created by K。 on 15/6/22.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "CategorTableViewCell.h"

@implementation CategorTableViewCell
-(void)dealloc
{
    [_NameLabel release];
    [_singerArray release];
    [_SingerLabel release];
    [_numberLabel release];
    [_collectLabel release];
    [_songArray release];
    [_categor release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self =[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
    
}
-(void)createSubViews
{
    UIButton *button =[UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(20, 20, self.frame.size.height-20, self.frame.size.height-20);
    [button setBackgroundImage:[UIImage imageNamed:@"dts_accessory_over_ear_chosen"] forState:UIControlStateNormal];
    [self addSubview:button];
  

    self.numberLabel =[[UILabel alloc]initWithFrame:CGRectMake(button.frame.origin.x+button.frame.size.width+5, button.frame.origin.y/2, 40, 40)];
 
    self.numberLabel.shadowColor = [UIColor colorWithRed:244.0f/255.0f green:147.0f/255.0f blue:23.0f/255.0f alpha:1.0f];

    [self addSubview:self.numberLabel];
    [_numberLabel release];
    
    
   self.NameLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.numberLabel.frame.origin.x+self.numberLabel.frame.size.width, self.numberLabel.frame.origin.y,[UIScreen mainScreen].bounds.size.width/3, self.numberLabel.frame.size.height)];
    
    self.NameLabel.shadowColor = [UIColor colorWithRed:244.0f/255.0f green:147.0f/255.0f blue:23.0f/255.0f alpha:1.0f];
    [self addSubview:self.NameLabel];
    [_NameLabel release];
    
    

    self.SingerLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.NameLabel.frame.origin.x, self.numberLabel.frame.origin.y+self.numberLabel.frame.size.height, [UIScreen mainScreen].bounds.size.width-button.frame.size.width-button.frame.origin.x, 40)];
    self.SingerLabel.shadowColor = [UIColor colorWithRed:244.0f/255.0f green:147.0f/255.0f blue:23.0f/255.0f alpha:1.0f];
//    self.SingerLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.numberLabel.frame.origin.x+10,self.numberLabel.frame.size.height+self.numberLabel.frame.origin.y, 250, 40)];

    [self addSubview:self.SingerLabel];
    [_SingerLabel release];
    
    UIImageView *ImageV =[[UIImageView alloc]initWithFrame:CGRectMake(button.frame.origin.x, self.SingerLabel.frame.size.height+self.SingerLabel.frame.origin.y, [UIScreen mainScreen].bounds.size.width-button.frame.origin.x*2 ,2)];
    ImageV.backgroundColor =[UIColor cyanColor];
    [self addSubview:ImageV];
    [ImageV release];
    


    
}
-(void)setCategor:(CategorDetail *)categor
{
    if (_categor != categor) {
        [_categor release];
        _categor =[categor retain];
    }
    self.NameLabel.text = categor.song_name;
    self.SingerLabel.text = categor.singer_name;

}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
